import React, { useState } from 'react'
import FilmList from './FilmList'

import './css/index.css'

export default function App() {
  const [type, setType] = useState(1)

  return (
    <div>
      <ul className='navbar'>
        <li
          className={type === 1 ? 'active' : ''}
          onClick={() => setType(1)}
        >
          正在热映
        </li>
        <li
          className={type === 2 ? 'active' : ''}
          onClick={() => setType(2)}
        >
          即将上映
        </li>
      </ul>
      <FilmList type={type}></FilmList>
    </div>
  )
}
